<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<!DOCTYPE HTML>  
<html>
<head>
<meta charset="utf-8"/>
<script type="text/javascript">
	function $$(id) {
		return document.getElementById(id);
	}
	
	function getGeoPos() {
		var geo = window.navigator.geolocation;
// 		alert(geo);
		
		geo.getCurrentPosition(function(position) {
			var br = '<br/>';
			var info = '<hr/>';
				info += 'longitude: ' + position.coords.longitude + br;
				info += 'latitude: ' + position.coords.latitude + br;
				info += 'accuracy: ' + position.coords.accuracy + br;
				info += 'altitude: ' + position.coords.altitude + br;
				info += 'altitudeAccuracy: ' + position.coords.altitudeAccuracy + br;
				info += 'heading: ' + position.coords.heading + br;
				info += 'speed: ' + position.coords.speed + br;
				info += 'timestamp: ' + position.timestamp + br;
				
			$$('info').innerHTML += info;	
				
		}, function(error) {
			alert(error.code);
		}, {
			timeout: 10 * 1000,
			maximumAge: 0
		});
	}
	
</script>

</head>
<body>
	<button onclick="getGeoPos()">position</button>
	<div id="info"></div>
</body>
</html>